using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Backend.JYD.Model.Bid;

namespace Backend.JYD.EFDAL.Mapping
{

    public class AutoBidSettingMap : EntityTypeConfiguration<AutoBidSetting>
    {
        public AutoBidSettingMap()
        {
            // Primary Key
            this.HasKey(t => new { t.AutoBidId });

            // Properties
            this.Property(t => t.AutoBidId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.UserId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("AutoBidSetting");
            this.Property(t => t.AutoBidId).HasColumnName("AutoBidId");
            this.Property(t => t.UserId).HasColumnName("UserId");
            this.Property(t => t.IsValid).HasColumnName("IsValid");
            this.Property(t => t.AutoType).HasColumnName("AutoType");
            this.Property(t => t.BidMoney).HasColumnName("BidMoney");
            this.Property(t => t.BidRate).HasColumnName("BidRate");
            this.Property(t => t.TopLimit).HasColumnName("TopLimit");
            this.Property(t => t.TermConfine).HasColumnName("TermConfine");
            this.Property(t => t.RateConfine).HasColumnName("RateConfine");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");

        }
    }
}
